package com.handsome.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import lombok.ToString;

import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Transient;
import java.util.Date;
import java.util.List;

/**
 * HsMenu
 *
 * @author Jiangda
 */
@Data
@ToString
@JsonInclude(JsonInclude.Include.NON_NULL)
public class HsMenu {
    /**
     * 菜单id
     */
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;

    /**
     * 父级id
     */
    private Integer parentId;

    /**
     * 菜单标题
     */
    private String title;

    /**
     * 菜单图标
     */
    private String icon;

    /**
     * 类型 0:根目录 1:菜单 2:方法
     */
    private Integer type;

    /**
     * 指向的地址
     */
    private String url;

    /**
     * 菜单代码
     */
    private String code;

    /**
     * 是否启动 0:启用 1:不启用
     */
    private Integer isDisabled;

    /**
     * 是否展开 0:不展开 1:展开
     */
    private Integer isOpen;

    /**
     * 生成日期
     */

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm")
    private Date createTime;

    @Transient
    private List<HsMenu> children;

    /**
     * 修改日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm")
    private Date editTime;

    @Transient
    private String titles;



}
